package com.crm.crm.mapper;

import com.crm.entity.PartnerType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CrmPartnerTypeMapper {
    @Insert("INSERT INTO crm_partner_type\n" +
            "(partner_type, partner_name)\n" +
            "VALUES('#{PartnerType}', '#{PartnerName}');\n")
    int Insert(PartnerType partnerType);

    @Delete("DELETE FROM crm_partner_type\n" +
            "WHERE partner_type='#{PartnerType}';\n")
    int Delete(String PartnerType);

    @Select("SELECT * FROM crm_partner_type")
    List<PartnerType> list();
}
